Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Deslizar foto | crear elemento de título | Sensible

Quiero agregar un elemento de título debajo de mi galería de imágenes creada con PhotoSwipe. Pero mi elemento de título no se pega debajo de la imagen. Se pega demasiado rápido en la imagen cuando el navegador cambia la escala verticalmente.

JS para crear el Elemento:

 lightbox.pswp.ui.registerElement({ name: 'werkInformationen', className: 'smallWerkInformationen', appendTo: 'wrapper', onInit: (el, pswp) => { var wrapDiv = document.createElement('div'); wrapDiv.className = 'wrapDiv'; var popUp = document.createElement('div'); popUp.className = 'popUpWerkInformationenTitle'; popUp.id = 'popUpWerkInformationenTitle'; var span = document.createElement('span'); span.className = 'child'; span.id = 'popUpWerkInformationenTitleSpan'; wrapDiv.appendChild(popUp); popUp.appendChild(span); el.appendChild(wrapDiv); pswp.on('change', (a,) => { var paramsFromCurrentWerk = new URLSearchParams(lightbox.pswp.currSlide["data"]["src"]); document.getElementById("popUpWerkInformationenTitleSpan").innerHTML = paramsFromCurrentWerk.get('id') + " | " + paramsFromCurrentWerk.get('werkName') + " | " + paramsFromCurrentWerk.get('material') + " | " + paramsFromCurrentWerk.get('kuenstler'); }); } });

Salida a HTML:

 <div class="smallWerkInformationen pswp__hide-on-close"> <div class="wrapDiv"> <div class="popUpWerkInformationenTitle"> <span class="child">PLACEHOLDER TEXT</span> </div> </div> </div>

CSS:

 .wrapDiv { min-width: 600px; } .smallWerkInformationen { position: relative; } #popUpWerkInformationenTitle { font-size: 12px; position: fixed; bottom: 0; width: 100%; text-align: center; margin-bottom: 30px; } #popUpWerkInformationenTitleSpan { text-align: center; background-color: black; color: #fff; border-radius: 5px; margin-left: 15px; margin-right: 15px; margin-top: 15px; font-size: 1rem !important; padding: 5px; }

Resultado esperado hasta que no haya espacio: Resultado esperado hasta que no haya espacio

Mi resultado:
Hay suficiente espacio para que quepa el elemento de texto a continuación, pero va en la imagen.

mi resultado

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Ya hay un ejemplo de Caption. Pero no es exactamente lo que quiero.

https://photoswipe.com/caption/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!